<template>
	<div>
		<router-link :to="{ path: '/' }">首页</router-link> |
		<router-link :to="{ path: '/life' }">生命周期</router-link> |
		<router-link :to="{ path: '/watch',query:{msg:'这是参数侦听器'}  }">watch侦听器</router-link> |
		<router-link :to="{ path: '/todolist' }">todolist</router-link> |

		<button @click="bindHome">首页</button>
		<button @click="bindLife">生命周期</button>
		<!-- 路由输出 -->
		<router-view></router-view>
	</div>
</template>

<script>
export default {
	methods: {
		bindHome() {
			this.$router.push({ path: '/' })
		},
		bindLife() {
			// this.$router.push({ path: '/life' })
			this.$router.replace({ path: '/life',query:{msg:'这是参数'} })
		},
	},
}
</script>

<style scoped></style>
